package com.example.demo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
public class Result {
    @ApiModelProperty(value = "响应编码，正常200")
    private String code;
    @ApiModelProperty(value = "响应消息，正常:success，错误：error")
    private String msg;
    @ApiModelProperty(value = "响应负载")
    private Object data;
    public static Result ok(String code, String msg, Object data) {
        return new Result(code, msg, data);
    }
    public static Result error(String code, String msg, Object data) {
        return new Result(code, msg, data);
    }
}
